Skip to content

feat(gui): Add Randomization Tool to Clinical Trials Tab#654

Merged
fderuiter merged 1 commit intomainfrom
clinical-trials-randomization-tool-15019054644524073895
Mar 13, 2026
Merged

feat(gui): Add Randomization Tool to Clinical Trials Tab#654
fderuiter merged 1 commit intomainfrom
clinical-trials-randomization-tool-15019054644524073895

Conversation

@fderuiter
Copy link
Owner

As "The Glassblower", I've added the missing Randomization tool to the math_explorer_gui's Clinical Trials tab.

Implementation details:

  • Selected Randomization: Interactive subject allocation tool from todo_gui.md.
  • Kept the codebase adherent to the OCP/SRP principles by implementing the ClinicalTrialsTool trait in a new struct, RandomizationTool, defined in its own file (randomization.rs).
  • Integrated SimpleRandomizer and BlockRandomizer from the core library math_explorer, preventing any mathematical logic duplication.
  • Made sure the GUI won't crash by using match and properly handling Results instead of using unwrap(). Errors are gracefully shown directly in the UI.
  • Validated with formatting and unit tests.

This completes the 4.2 Clinical Trials roadmap module.


PR created automatically by Jules for task 15019054644524073895 started by @fderuiter

- Created `math_explorer_gui/src/tabs/clinical_trials/randomization.rs` with `RandomizationTool`.
- Implemented Strategy pattern via `ClinicalTrialsTool` to add it to `ClinicalTrialsTab`.
- Leveraged `math_explorer::applied::clinical_trials::design::{SimpleRandomizer, BlockRandomizer}`.
- Updated `todo_gui.md` to mark Randomization feature and `4.2 Clinical Trials` section as complete.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@fderuiter fderuiter marked this pull request as ready for review March 13, 2026 18:39
Copilot AI review requested due to automatic review settings March 13, 2026 18:39
@fderuiter fderuiter merged commit 50c7972 into main Mar 13, 2026
1 check passed
@fderuiter fderuiter deleted the clinical-trials-randomization-tool-15019054644524073895 branch March 13, 2026 18:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the missing Randomization tool to the Clinical Trials tab in math_explorer_gui, leveraging the existing math_explorer clinical trials randomization strategies.

Changes:

  • Implemented a new RandomizationTool (simple + block randomization) as a ClinicalTrialsTool.
  • Wired the new tool into the Clinical Trials tab tool selector.
  • Marked the Clinical Trials roadmap item as implemented in todo_gui.md.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
todo_gui.md Marks Clinical Trials Randomization as implemented in the GUI roadmap.
math_explorer_gui/src/tabs/clinical_trials/randomization.rs New GUI tool implementing interactive subject allocation using core randomizers.
math_explorer_gui/src/tabs/clinical_trials/mod.rs Registers the Randomization tool in the Clinical Trials tab.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if self.randomization_type == RandomizationType::Block {
ui.horizontal(|ui| {
ui.label("Block Size:");
ui.add(egui::DragValue::new(&mut self.block_size).range(2..=100));
@@ -0,0 +1,132 @@
use crate::tabs::clinical_trials::ClinicalTrialsTool;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants